'use strict';
module.exports = app => {
  // 订单子表
  const {STRING, INTEGER, FLOAT, DATE} = app.Sequelize;
  const OrderChild = app.model.define('s_order_child', {
    id: {type: INTEGER, primaryKey: true, autoIncrement: true},
    name: STRING(30),
    user_id: INTEGER,
    goods_ids: {
      type: STRING,
      comment: '商品id组',
    },
    status: {
      type: INTEGER,
      comment:
        '-1：已删除，1:已下单，2:已支付，3:已发货, 4:退货中，5:退款中，6:已完成，7：已取消',
    },
    price: {
      type: FLOAT,
      comment: '价格',
    },
    order_time: {
      type: DATE,
      comment: '下单时间',
    },
    payment_time: {
      type: DATE,
      comment: '支付时间',
    },
    await_payment_time: {
      type: DATE,
      comment: '等待支付时间',
    },
  });

  return OrderChild;
};
